home *** CD-ROM | disk | FTP | other *** search
/ Gold Medal Software 2 / Gold Medal Software Volume 2 (Gold Medal) (1994).iso / windows / win31 / macsyma.arj / MACSDEMO.EXE / CYL2SPH.OUT < prev    next >
Text File  |  1993-09-14  |  2KB  |  29 lines

  1.  
  2. (c1) /* Conversion of the Laplacian from Cylindrical Coordinates to 
  3.      Spherical Coordinates */
  4. depends(u,[r,theta,phi])$
  5.  
  6. (c2) /* Input the transformation rules from the cylindrical system to the
  7.       spherical system. */
  8. (gradef(r,z,z/r),
  9.  gradef(r,rho,rho/r),
  10.  gradef(theta,z,-rho/r^2),
  11.  gradef(theta,rho,z/r^2))$
  12.  
  13. (c3) expop:1$
  14.  
  15. (c4) /* Now just input the Laplacian in cylindrical coordinates,
  16.    and let the chain rule do its thing. */
  17. diff(u,rho,2)+1/rho*diff(u,rho)+1/rho^2*diff(u,phi,2)+diff(u,z,2);
  18. |$label(0,15,Times New Roman,$(d4$))$q($q($sup(d,2)u,d$sup($greektext(q),2))$in( )$sup(z,2),$sup(r,4))$hinge()$in( + )$q($q($sup(d,2)u,d$sup(r,2))$in( )$sup(z,2),$sup(r,2))$hinge()$in( - )$q($q(du,dr)$in( )$sup(z,2),$sup(r,3))$hinge()$in( + )$q($q(du,d$greektext(q))$in( )z,$sup(r,2)$in( )$greektext(r))$hinge()$in( + )$q($sup($greektext(r),2)$in( )$q($sup(d,2)u,d$sup($greektext(q),2)),$sup(r,4))$hinge()$in( + )$q($sup($greektext(r),2)$in( )$q($sup(d,2)u,d$sup(r,2)),$sup(r,2))$hinge()$in( - )$q($sup($greektext(r),2)$in( )$q(du,dr),$sup(r,3))$hinge()$in( + )$q(3$in( )$q(du,dr),r)$hinge()$in( + )$q($q($sup(d,2)u,d$sup($greektext(f),2)),$sup($greektext(r),2))
  19.  
  20. (c5) subst(r^2-rho^2,z^2,%);
  21. |$label(0,15,Times New Roman,$(d5$))$q($q(du,d$greektext(q))$in( )z,$sup(r,2)$in( )$greektext(r))$hinge()$in( + )$q($q($sup(d,2)u,d$sup($greektext(q),2)),$sup(r,2))$hinge()$in( + )$q($sup(d,2)u,d$sup(r,2))$hinge()$in( + )$q(2$in( )$q(du,dr),r)$hinge()$in( + )$q($q($sup(d,2)u,d$sup($greektext(f),2)),$sup($greektext(r),2))
  22.  
  23. (c6) subst([z=r*cos(theta),rho=r*sin(theta),
  24.        cos(theta)=sin(theta)*cot(theta)],%);
  25. |$label(0,15,Times New Roman,$(d6$))$q($q($sup(d,2)u,d$sup($greektext(q),2)),$sup(r,2))$hinge()$in( + )$q(cot$paren($greektext(q))$in( )$q(du,d$greektext(q)),$sup(r,2))$hinge()$in( + )$q($sup(d,2)u,d$sup(r,2))$hinge()$in( + )$q(2$in( )$q(du,dr),r)$hinge()$in( + )$q($q($sup(d,2)u,d$sup($greektext(f),2)),$sup(r,2)$in( )$sup(sin,2)$paren($greektext(q)))
  26.  
  27. (c7) /* Clean Up */
  28. (reset(expop), remove([r,theta],[dependency,atomgrad],u,[dependency,special]))$
  29.